package com.example.s.bean;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

public class User {

    /**
     * uid : 813154e0-c1b4-11eb-b472-d78c758d2970
     * nickName : 小老板
     * headPhoto : https://thirdwx.qlogo.cn/mmopen/vi_32/PBicsK1qKM12Id5WZkqB2T4bMG7Q41Mc14vPjWvYE0wVGfCRExka3HFq4jHg2wKlnVvOD8bfUIG8XlCyicH5635Q/132
     * account : 161199
     * introduce :
     * fans : 0
     * followNum : 0
     * likes : 4
     * email : 1611993222@qq.com
     */

    private String uid;
    private String nickName;
    private String headPhoto;
    private String account;
    private String introduce;
    private int fans;
    private int followNum;
    private int likes;
    private String email;

    public static User objectFromData(String str) {

        return new Gson().fromJson(str, User.class);
    }

    public static List<User> arrayUserFromData(String str) {

        Type listType = new TypeToken<ArrayList<User>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getHeadPhoto() {
        return headPhoto;
    }

    public void setHeadPhoto(String headPhoto) {
        this.headPhoto = headPhoto;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getIntroduce() {
        return introduce;
    }

    public void setIntroduce(String introduce) {
        this.introduce = introduce;
    }

    public int getFans() {
        return fans;
    }

    public void setFans(int fans) {
        this.fans = fans;
    }

    public int getFollowNum() {
        return followNum;
    }

    public void setFollowNum(int followNum) {
        this.followNum = followNum;
    }

    public int getLikes() {
        return likes;
    }

    public void setLikes(int likes) {
        this.likes = likes;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }
}
